/**
 * 
 */
package com.oolong.account.web;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author beralee
 * 
 */
// 标记它是个SPRING的BEAN，是MVC里的C
@Controller
// 表示这个类就是login.do
@RequestMapping("/quit.do")
public class QuitController {
	Logger logger = Logger.getLogger(QuitController.class);
	String message = " ";

	@RequestMapping(method = RequestMethod.GET)
	// @RequestParam表示将页面上的元素赋给后面的变量，可直接在类里使用
	public String process(HttpSession session, ModelMap model,
			HttpServletResponse response) {
		session.removeAttribute("user");
		message = "成功退出";
		model.addAttribute("message", message);
		response.setContentType("text/html;charset=UTF-8");
		return "login";
	}
}
